package com.rasou.annotation;

import java.lang.annotation.*;

import static org.eclipse.microprofile.config.spi.ConfigSource.DEFAULT_ORDINAL;

/**
 * Annotation for ConfigSource
 *{@link org.eclipse.microprofile.config.spi.ConfigSource}
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Repeatable(ConfigSources.class)
public @interface ConfigSource {

    /**
     *
     * The name of the configuration source. The name might be used for logging or for analysis of configured values, and also may be used in ordering decisions.
     * Returns: the name of the configuration source
     *
     * @see {@link org.eclipse.microprofile.config.spi.ConfigSource#getName()}
     */
    String name() default "";

    /**
     * the source of Configuration
     * @return
     */
    String resource();

    /**
     * The ordinal of {@link org.eclipse.microprofile.config.spi.ConfigSource}
     *
     */
    int ordinal() default DEFAULT_ORDINAL;

    String encoding() default "UTF-8";

    /**
     * The factory to create ConfigSource
     */
    Class<? extends ConfigSourceFactory> factory() default ConfigSourceFactory.class;

}
